import { createApp } from 'vue'
import App from './App.vue'

console.log('Vue3项目启动的主文件 ')

const app = createApp(App)     // 创建一个根的应用实例对象  全局只有一个 

// 1. 全局组件注册 
import Demo from './components/Demo.vue'
app.component('Demo', Demo)
import Dao from './components/Dao.vue'
app.component('Dao', Dao)
import MyHead from './components/MyHead.vue'
app.component('MyHead', MyHead)


// 2. 全局的样式
import './styles/index.scss'


// 3. 挂载路由
import router from './router'
app.use(router)


// 4. 引入 vant 
import Vant from 'vant'
import 'vant/lib/index.css';
app.use(Vant)

// 5.引入pinia
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-persistedstate-plugin'
const pinia = createPinia()
pinia.use(createPersistedState())
app.use(pinia)

app.mount('#app')    // 应用实例挂载在一个容器元素
